﻿#pragma once

#include "Scene/Effect/PostProcessEffect.h"
#include "Asset/AssetManager.h"

class CrosshairEffect : public PostProcessEffect
{
public:
  CrosshairEffect(bool enabled)
      : PostProcessEffect(
            AssetManager::LoadAsset<Shader>("assets/shaders/src/Crosshair"),
            enabled) {}

  void Update() override
  {
    float aspectRatio = Window::GetInstance().GetAspectRatio();

    m_shader->SetFloat("uSize", m_crosshairSize);
    m_shader->SetFloat("uVerticalWidth", m_crosshairVerticalWidth);
    m_shader->SetFloat("uHorizontalWidth", m_crosshairHorizontalWidth);
    m_shader->SetFloat("uAspectRatio", aspectRatio);
  }

private:
  float m_crosshairSize = 0.03f;
  float m_crosshairVerticalWidth = 0.2f;
  float m_crosshairHorizontalWidth = 0.2f;
};